/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2025-01-08
 * Time: 13:48
 */
public class test1 {
    /*
    LeetCode 125 验证回文串
     */
    public boolean isPalindrome(String ss) {
        StringBuilder tmp = new StringBuilder();
        char[] s = ss.toCharArray();
        for(char c:s){
            if(c>='a'&&c<='z'){
                tmp.append(c);
            }else if(c>='A' && c<='Z'){
                tmp.append((char)(c+32));
            }else if(c>='0'&&c<='9'){
                tmp.append(c);
            }
        }
        s = tmp.toString().toCharArray();
        int left = 0;
        int right = s.length-1;
        while(left<=right){
            if(s[left++]!=s[right--]){
                return false;
            }
        }
        return true;
    }
}
